//
import './views/css/es-sdk-css.css';

//--------------------router-----------------------
import routes from "./routes.ts";
//--------------------ESApp-----------------------
import {ESApp,} from '@extscreen/es3-vue';
import application from './App.vue';

import {createESApp} from "@extscreen/es3-core";
//
import {install} from './components';
//
import {ESComponent} from "@extscreen/es3-component";
//
import {createESPlayer} from "@extscreen/es3-player";
import {createESVideoPlayer} from "@extscreen/es3-video-player";
import {createESADPlayer} from "@extscreen/es3-ad-player";
import {createESPlayerManager} from "@extscreen/es3-player-manager";
//

//--------------------module--------------------------

//--------------------components-----------------------
const routerOptions = {
  main: 'index',
  error: 'error',
  limit: 10,
  routes: routes,
}

const app: ESApp = createESApp(application, routerOptions);

app.use(install);

app.use(ESComponent);
const player = createESPlayer();
app.use(player);
const playerManager = createESPlayerManager()
app.use(playerManager);
const videoPlayer = createESVideoPlayer();
app.use(videoPlayer);

const ADPlayer = createESADPlayer();
app.use(ADPlayer);
//---------------------------QuickTVUI----------------------------------
import '@quicktvui/quicktvui3/dist/index.css';
import {QuickTVUI} from "@quicktvui/quicktvui3";

app.use(QuickTVUI);
//---------------------------网络请求----------------------------------
import {createRequestManager, RequestManager} from "./api/request/RequestManager";

const requestManger: RequestManager = createRequestManager()
app.use(requestManger);
//---------------------------网络接口----------------------------------

//---------------------------启动管理----------------------------------
import {createLaunch, Launch} from "./tools/launch/Launch";

const launch: Launch = createLaunch()
app.use(launch);
app.config.errorHandler = function (err, vm, info) {
  console.error('Caught an error during watcher callback:', err, info);
  // 这里可以添加上报错误到服务器或者显示友好错误提示等逻辑
};
import {EsProtocolDialog} from '@extscreen/es-protocol-dialog-vue3';
import '@extscreen/es-protocol-dialog-vue3/dist/index.css';
app.use(EsProtocolDialog)
